$(".cbbs").click(function(){
	$('.coll_bbs').replaceWith("");
	
	var cid = $(this).attr('cid');
	var gid = $(this).attr('gid');
	$(this).parent().parent().parent().append('<div class="coll_bbs"><form action="" method="post" id="cbbs"><input name="content" /><p class="btn_comm"><a href="javascript:addcBbs('+cid+','+gid+');">提交</a></p></form></div>');
});

$(".lookcbbs").click(function(){
	$(".ccomm").replaceWith("");
	
	var cid = $(this).attr('cid');
	var gid = $(this).attr('gid');
	var thisClass = $(this).parent().parent().parent();
	
	$.get(url+"/getcbbs/cid/"+cid, function(data){
		thisClass.append(data);
	});
});

function addBbs(){
	var options = {
			url:url+"/addbbs/gid/"+id, //提交给哪个执行 
			type:'POST',
			success: function(){ alert("评论成功");} //显示操作提示 
	};
	
	$('#bbs').ajaxSubmit(options);
}

function addcBbs(cid,gid){
	var options = {
			url:url+"/addbbs/gid/"+gid+"/cid/"+cid, //提交给哪个执行 
			type:'POST',
			success: function(){ alert("评论成功");} //显示操作提示 
	};
	
	$('#cbbs').ajaxSubmit(options);
	
	$('.coll_bbs').replaceWith("");
	
}

function  coll() {//滚动条位置
	$.get(url+"/coll/id/"+id, function(data){
		$('.like span').html(parseInt($('.like span').html())+1);
	});
}

function share(){
	window.open('http://weibo.com/nanbozhu');
}
